package com.sh.舱壁模式;

public class BulkheadPatternExample {
    public static void main(String[] args) {
        Resource resource1 = new Resource();
        Resource resource2 = new Resource();
        Resource resource3 = new Resource();

        BulkheadService bulkheadService = new BulkheadService(2);  // 控制资源

        bulkheadService.executeTask(resource1);
        bulkheadService.executeTask(resource2);
        bulkheadService.executeTask(resource3);

        bulkheadService.shutdown();
    }
}